<section id="content">	
<script>
function backToAdd(){
	$("#main_form").prop("action", "/it_center/Faculties/faculty_add");
	return $("#main_form").submit();
}

function backToEdit(){
	$("#main_form").prop("action", "/it_center/Faculties/faculty_edit");
	return $("#main_form").submit();
}

</script>
<form id="main_form" method="post" action="/it_center/Faculties/facultyRegist">	
<?php if (isset($facultyId)){ ?>
	<input type="hidden" name="facultyId" value="<?php echo $facultyId; ?>"/>
<?php }?>
<input type="hidden" name="isBack" value="yes"/>
<input type="hidden" name="facultyName" value="<?php echo $facultyName ;?>"/>
<input type="hidden" name="facultyEmail" value="<?php echo $facultyEmail ;?>"/>
<input type="hidden" name="facultyMobile" value="<?php echo $facultyMobile ;?>"/>
<input type="hidden" name="facultyTel" value="<?php echo $facultyTel;?>"/>
<input type="hidden" name="facultyImage" value="<?php echo $facultyImage ;?>"/>
<input type="hidden" name="facultyDesc" value="<?php echo $facultyDesc;?>"/>
<input type="hidden" name="facultySubIds" value="<?php echo $facultySubIds;?>"/>
<?php if (isset($facultyOldImage)){
	echo '<input type="hidden" name="facultyOldImage" value="'.$facultyOldImage.'"/>';
}
?>

<?php if (isset($facultyTempFile)){
	echo "<input type='hidden' name='facultyTempFile' value='".$facultyTempFile."'/>";
}
?>  
<?php if(isset($facultyId)){ ?>
	<center><H2>Cập nhật giảng viên</H2></center>
<?php } else { ?>
	<center><H2>Thêm giảng viên</H2></center>
<?php } ?>
 
 <table id="edit_table">
	<tr>
		<td class="edit_column" width="170">
			Tên giảng viên
		</td>
		<td style="text-align: left;">
			<?php echo $facultyName ;?>
		</td>
	</tr>
	<tr>
		<td class="edit_column">
			Email
		</td>
		<td style="text-align: left;">
			<?php echo $facultyEmail;?>
		</td>
	</tr>
	<tr>
		<td class="edit_column">
			Điện thoại
		</td>
		<td style="text-align: left;">
			<?php echo $facultyTel;?>
		</td>
	</tr>
	
	<tr>
		<td class="edit_column">
			Mobile
		</td>
		<td style="text-align: left;">
			<?php echo $facultyMobile;?>
		</td>
	</tr>
	<tr>
		<td class="edit_column">
			Hình ảnh
		</td>
		<td style="text-align: left;">
			<?php echo $facultyImage;?>
		</td>
	</tr>
	<tr>
		<td class="edit_column">
			Môn học phụ trách
		</td>
		<td>
			<?php echo $fctSubNames;?>
		</td>
	</tr>
	<tr>
		<td class="edit_column" style="vertical-align: top;">
			Thông tin
		</td>
		<td style="text-align: left;">
			<textarea disabled style="width: 99%;" rows="10"><?php echo html_entity_decode($facultyDesc, ENT_QUOTES, 'utf-8');?></textarea>
		</td>
	</tr>
	<tr>
		<td colspan="2" style="text-align: center;">
			<button type="submit">Hoàn Tất</button>
			<button type="button" onclick="<?php echo (isset($facultyId)) ? "backToEdit()" : "backToAdd()";?>">Quay Lại</button>
		</td>
	</tr>
</table>
</form>
</section>   